Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Issue 235 - Created new Helper Function to create generic shortcut #238

Closed
wants to merge 1 commit into from

Conversation

gep13
Copy link
Member

@gep13 gep13 commented Jan 30, 2013

As described here:

#235

I have created a generic Install-ChocoatelyShortcut helper function to allow a shortcut, with optional parameters, to be created anywhere the user specifies.

I believe that this may also solve Issue 218 as well:

#218

I have included 7 new Unit Tests to verify the functionality.

The only thing that I am not "convinced" by are the last two tests. I have created fake files at the root of the C:\ drive, which are tided up after the test is completed. Obviously, it would be better to mock these files. I attempted to use TestDrive for this purpose, however, I could not get this to work. I believe that this is due to .CreateShortcut being a call into a ComObject, which TestDrive can't handle.

Let me know if you have any questions.

Thanks

Gary

@ferventcoder
Copy link
Contributor

Thanks!

@gep13
Copy link
Member Author

gep13 commented Jan 31, 2013

Not a problem at all. Would welcome any feedback (good or bad), it can only help me to get better :-)

@rismoney
Copy link
Contributor

asserts changed in new pester, particularly around piping...
I really like this PR.

And I would rebase fixup your commits so its a clean bisectable history. With all the outstanding PRs we need to make sure if we introduce a bug, we can use git bisect and git blame successfully going forward.

@gep13
Copy link
Member Author

gep13 commented Apr 19, 2013

Hey,

More than happy to do what ever is required, but can I ask for a bit of hand holding for this, still relatively new to git, and don't want to do anything wrong :-)

Are you simply looking for me to rebase so that there is a single commit for the PR? If so, could you walk me through the steps?

Thanks, much appreciated! My experience with git to date has been as a single developer working in one branch and one remote, so I haven't yet ventured into the sort of details that you guys are now facing.

Also, is there something that I need to change around the asserts? If so, happy to do this as well.

Thanks

Gary

@rismoney
Copy link
Contributor

C:\gitrepos\chocolatey [branch]> git remote -v
origin [email protected]:rismoney/chocolatey.git (fetch)
origin [email protected]:rismoney/chocolatey.git (push)
upstream [email protected]:chocolatey/chocolatey.git (fetch)
upstream [email protected]:chocolatey/chocolatey.git (push)

git checkout master
git fetch upstream
git rebase upstream/master

then
git checkout yourbranch
git fetch upstream
git rebase upstream/master - this puts your changes on top of the current HEAD

then
git rebase -i upstream/master
editor should be launched

you should see a list of all your commits, with the word pick in front.
starting with the second commit change the first word from pick to fixup
repeat for all subsequent comits
close editor with save

then
git commit --amend to fixup the single commit message

then
git push -f origin

you will then have a single commit that looks like you did it perfectly the 1st time.

@gep13
Copy link
Member Author

gep13 commented Apr 19, 2013

Sounds easy :P

I will let you know how i get on.

Thanks for all your help!

Gary

Sent from my Windows Phone


From: Rich Siegelmailto:[email protected]
Sent: ‎19/‎04/‎2013 21:14
To: chocolatey/chocolateymailto:[email protected]
Cc: Gary Ewan Parkmailto:[email protected]
Subject: Re: [chocolatey] Issue 235 - Created new Helper Function to create generic shortcut (#238)

C:\gitrepos\chocolatey [branch]> git remote -v
origin [email protected]:rismoney/chocolatey.git (fetch)
origin [email protected]:rismoney/chocolatey.git (push)
upstream [email protected]:chocolatey/chocolatey.git (fetch)
upstream [email protected]:chocolatey/chocolatey.git (push)

git checkout master
git fetch upstream
git rebase upstream/master

then
git checkout yourbranch
git fetch upstream
git rebase upstream/master - this puts your changes on top of the current HEAD

then
git rebase -i upstream/master
editor should be launched

you should see a list of all your commits, with the word pick in front.
starting with the second commit change the first word from pick to fixup
repeat for all subsequent comits
close editor with save

then
git commit --amend to fixup the single commit message

then
git push -f origin

you will then have a single commit that looks like you did it perfectly the 1st time.


Reply to this email directly or view it on GitHub:
#238 (comment)

@gep13
Copy link
Member Author

gep13 commented Apr 20, 2013

Ok, I think I have done everything that you suggested, but I am now also a little confused. How did it get into this pull request already? I expected the last command that I ran, i.e:

git push -f origin

To put the rewritten commits into my forked repo, and from there I would have to update the pull request, but this seems to have happened automagically. What gives? Or what am I missing?

Thanks for all the help by the way, it really helped! Would have never figured that out on my own! :-)

Gary

@ferventcoder
Copy link
Contributor

Once you push to a remote that is part of a pull request, it updates the PR
automagically. That's why we always want PRs in branches, so you don't
accidentally include something you don't want in the PR.

On Saturday, April 20, 2013, Gary Ewan Park wrote:

Ok, I think I have done everything that you suggested, but I am now also a
little confused. How did it get into this pull request already? I expected
the last command that I ran, i.e:

git push -f origin

To put the rewritten commits into my forked repo, and from there I would
have to update the pull request, but this seems to have happened
automagically. What gives? Or what am I missing?

Thanks for all the help by the way, it really helped! Would have never
figured that out on my own! :-)

Gary


Reply to this email directly or view it on GitHubhttps://github.com//pull/238#issuecomment-16705844
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@gep13
Copy link
Member Author

gep13 commented Apr 20, 2013

Gotcha, that makes sense. Have to take my hat off to Git and Github, they really do provide a great system. Once you get past the learning curve that is :-)

- Added Helper Function
- Created Unit Test to verify Function
- Added Synopsis to help with Documentation
- Used new syntax for Pester 2 asserts
@rismoney
Copy link
Contributor

It really is awesome. I hope I can get a lot of posh people on it at the summit this week. I Cant stand codeplex.

@Redsandro
Copy link
Contributor

Gep13 said:

I believe that this may also solve Issue 218 as well:
#218

This adds a shortcut to the desktop which does not make the application appear in the Windows 7 or Windows 8 start menu. It is not indexed for searching.

This #228 allows pinning to start. I use it in my own installers, but this should really be included in Chocolatey imo.

I think it'd be best to encourage packagers to do pin to start anything that is not a command line tool as discussed here: #305

@gep13 gep13 assigned gep13 and unassigned ferventcoder Feb 27, 2014
@gep13
Copy link
Member Author

gep13 commented Mar 5, 2014

Due to me deleting the original branch that this PR was submitted on, I had to recreate it, as a result, the linking is broken. However, I have recreated the PR, and pulled it in here:

201ad95

@gep13 gep13 closed this Mar 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants